package cn.wen233.orderconsumer.infrustructure.feign;


import cn.wen233.common.api.R;
import cn.wen233.domain.Order;
import cn.wen233.orderconsumer.config.FeignConfiguration;
import cn.wen233.orderconsumer.infrustructure.fallback.OrderFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author wenei
 * @date 2021-06-05 15:33
 */
@FeignClient(
        name = "order-service",
        path = "/orders",
        contextId = "IOrderFeign",
        qualifier = "IOrderFeign",
        configuration = FeignConfiguration.class,
//        fallback = OrderFeignFallback.class,
        fallbackFactory = OrderFeignFallbackFactory.class
)
public interface OrderFeign {

    @GetMapping("/{id}")
    R<Order> getOrder(@PathVariable String id);
}
